<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>转院界面</title>
    <link rel="stylesheet" href="../css/turnHospital.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/turnHospital.js"></script>
</head>
<body>
<!--转院操作界面-->
<div class="turnHospitalOper">
    <button id="turnHospitalOperInputAddBtn">新增信息</button>
    <label for="turnHospitalOperInputName">病人姓名</label>
    <input type="text" class="turnHospitalOperInput" id="turnHospitalOperInputName" placeholder="请输入病人姓名">
    <button id="turnHospitalOperSelectNameBtn">点击查询</button>
    <label for="turnHospitalOperInputDate">转院日期</label>
    <input type="date" class="turnHospitalOperInput" id="turnHospitalOperInputDate" placeholder="请输入转院日期">
    <button id="turnHospitalOperSelectDateBTn">点击查询</button>
</div>
<hr/>
<!--历史信息显示界面-->
<div class="turnHospitalInformationShow">
    <table id="tb_turnHospital" cellspacing="0" cellpadding="2" width="100%" border="1">
        <tr align="center" bgcolor="#dcdcdc">
            <td style="width:100px;">编号</td>
            <td>病人姓名</td>
            <td>性别</td>
            <td>年龄</td>
            <td>联系方式</td>
            <td>转移地点</td>
            <td>转移时间</td>
            <td>处理医师</td>
            <td>备注</td>
            <td>操作</td>
        </tr>
        <!--<tr>-->
            <!--<td style="width:100px;">1</td>-->
            <!--<td>张三</td>-->
            <!--<td>男</td>-->
            <!--<td>28</td>-->
            <!--<td>17887195689</td>-->
            <!--<td>二院</td>-->
            <!--<td>2019/01/09</td>-->
            <!--<td>张信哲</td>-->
            <!--<td>无</td>-->
            <!--<td><button class="turnHospitalInformationShowUpdateBtn" data-id="">编辑</button><button class="turnHospitalInformationShowCancelBtn" data-id="">删除</button></td>-->
        <!--</tr>-->
    </table>
</div>
<!--新增信息界面-->
<div class="turnHospitalAddInformation">
    <div>
        <label for="turnHospitalAddInformationInputName">病人姓名</label>
        <input type="text" class="turnHospitalAddInformationInput" id="turnHospitalAddInformationInputName" placeholder="请输入病人姓名">
    </div>
    <div>
        <label for="turnHospitalAddInformationInputPlace">转移地点</label>
        <input type="text" class="turnHospitalAddInformationInput" id="turnHospitalAddInformationInputPlace" placeholder="请输入转移地点">
    </div>
    <div>
        <label for="turnHospitalAddInformationInputTime">转移时间</label>
        <input type="date" class="turnHospitalAddInformationInput" id="turnHospitalAddInformationInputTime" placeholder="请输入转移时间">
    </div>
    <div>
        <label for="turnHospitalAddInformationInputPerson">处理医师</label>
        <input type="text" class="turnHospitalAddInformationInput" id="turnHospitalAddInformationInputPerson" placeholder="请输入处理医师">
    </div>
    <div>
        <label for="turnHospitalAddInformationInputRemark">备注</label>
        <input type="text" class="turnHospitalAddInformationInput" id="turnHospitalAddInformationInputRemark" placeholder="请输入备注信息（可空）">
    </div>
    <div>
        <button id="turnHospitalAddSureBtn">确认</button>
        <button id="turnHospitalAddBackBtn">返回</button>
    </div>
</div>
<!--编辑框弹出界面-->
<div class="turnHospitalClickUpdateGetInfo">
    <div>
        <label for="turnHospitalName">病人姓名</label>
        <input type="text" class="turnHospital" id="turnHospitalName" value="" disabled="disabled">
    </div>
    <div>
        <label for="turnHospitalPlace">转移地点</label>
        <input type="text" class="turnHospital" id="turnHospitalPlace" value="">
    </div>
    <div>
        <label for="turnHospitalDate">转移日期</label>
        <input type="date" class="turnHospital" id="turnHospitalDate" value="">
    </div>
    <div>
        <label for="turnHospitalPerson">处理医师</label>
        <input type="text" class="turnHospital" id="turnHospitalPerson" value="">
    </div>
    <div>
        <label for="turnHospitalRemark">备注</label>
        <input type="text" class="turnHospital" id="turnHospitalRemark" value="">
    </div>
    <div>
        <button id="turnHospitalclickUpdateGetInfoSureBtn">确认</button>
        <button id="turnHospitalclickUpdateGetInfoBackBtn">返回</button>
    </div>
</div>
<div id="over"></div>
<div></div>
<!--表格宽度可伸缩事件-->
<script type="text/javascript">
    var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
    var table = document.getElementById("tb_turnHospital");
    for (j = 0; j < table.rows[0].cells.length; j++) {
        table.rows[0].cells[j].onmousedown = function () {
//记录单元格
            tTD = this;
            if (event.offsetX > tTD.offsetWidth - 10) {
                tTD.mouseDown = true;
                tTD.oldX = event.x;
                tTD.oldWidth = tTD.offsetWidth;
            }
//记录Table宽度
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
//tTD.tableWidth = table.offsetWidth;
        };
        table.rows[0].cells[j].onmouseup = function () {
//结束宽度调整
            if (tTD == undefined) tTD = this;
            tTD.mouseDown = false;
            tTD.style.cursor = 'default';
        };
        table.rows[0].cells[j].onmousemove = function () {
//更改鼠标样式
            if (event.offsetX > this.offsetWidth - 10)
                this.style.cursor = 'col-resize';
            else
                this.style.cursor = 'default';
//取出暂存的Table Cell
            if (tTD == undefined) tTD = this;
//调整宽度
            if (tTD.mouseDown != null && tTD.mouseDown == true) {
                tTD.style.cursor = 'default';
                if (tTD.oldWidth + (event.x - tTD.oldX)>0)
                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
//调整列宽
                tTD.style.width = tTD.width;
                tTD.style.cursor = 'col-resize';
//调整该列中的每个Cell
                table = tTD; while (table.tagName != 'TABLE') table = table.parentElement;
                for (j = 0; j < table.rows.length; j++) {
                    table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                }
//调整整个表
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
//table.style.width = table.width;
            }
        };
    }
</script>
</body>
</html>